const state = {
  // 是否折叠
  isCollapse: false,
  evaluateList: [],
  tempZip: {}
}

const getters = {
  isCollapse: (state) => {
    return state.isCollapse
  },
  evaluateList: (state) => {
    return state.evaluateList
  },
  tempZip: (state) => {
    return state.tempZip
  }
}

const actions = {
  setIsCollapse(context, payload) {
    return new Promise((resolve) => {
      // 模拟登录成功，写入 token 信息
      context.commit('setIsCollapse', payload)
      resolve()
    })
  },
  setEvaluatedList(context, payload) {
    return new Promise((resolve) => {
      context.commit('setEvaluatedList', payload)
      resolve()
    })
  },
  setTempZip(context, payload) {
    return new Promise((resolve) => {
      context.commit('setTempZip', payload)
      resolve()
    })
  }
}

const mutations = {
  setIsCollapse(state, status) {
    state.isCollapse = status
  },
  setEvaluatedList(state, evaluatedList) {
    state.evaluateList = evaluatedList
  },
  setTempZip(state, tempZip) {
    state.tempZip = tempZip
  }
}

export default {
  namespaced: true,
  state,
  actions,
  getters,
  mutations
}
